﻿@page "/account/manage-profile"
@inherits AccountManageBase
<Row>
    <Column ColumnSize="ColumnSize.Is12">
        <Tabs @bind-SelectedTab="@SelectedTab" TabPosition="TabPosition.Left" Pills="true">
            <Items>
                <Tab Name="Password">@L["ProfileTab:Password"]</Tab>
                <Tab Name="PersonalInfo">@L["ProfileTab:PersonalInfo"]</Tab>
            </Items>
            <Content>
                @if (ChangePasswordModel != null)
                {
                    <TabPanel Name="Password">
                        <Field>
                            <FieldLabel>@L["DisplayName:CurrentPassword"]</FieldLabel>
                            <TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.CurrentPassword" />
                        </Field>
                        <Field>
                            <FieldLabel>@L["DisplayName:NewPassword"]</FieldLabel>
                            <TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPassword" />
                        </Field>
                        <Field>
                            <FieldLabel>@L["DisplayName:NewPasswordConfirm"]</FieldLabel>
                            <TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPasswordConfirm" />
                        </Field>
                        <Field>
                            <Button Color="Color.Primary" Clicked="@ChangePasswordAsync">@L["Save"]</Button>
                        </Field>
                    </TabPanel>
                }
                @if (PersonalInfoModel != null)
                {
                    <TabPanel Name="PersonalInfo">
                        <Field>
                            <FieldLabel>@L["DisplayName:UserName"]</FieldLabel>
                            <TextEdit @bind-text="@PersonalInfoModel.UserName" />
                        </Field>
                        <Fields>
                            <Field ColumnSize="ColumnSize.Is6">
                                <FieldLabel>@L["DisplayName:Name"]</FieldLabel>
                                <TextEdit @bind-text="@PersonalInfoModel.Name" />
                            </Field>
                            <Field ColumnSize="ColumnSize.Is6">
                                <FieldLabel>@L["DisplayName:Surname"]</FieldLabel>
                                <TextEdit @bind-text="@PersonalInfoModel.Surname" />
                            </Field>
                        </Fields>
                        <Field>
                            <FieldLabel>@L["DisplayName:Email"]</FieldLabel>
                            <TextEdit @bind-text="@PersonalInfoModel.Email" />
                        </Field>
                        <Field>
                            <FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel>
                            <TextEdit @bind-text="@PersonalInfoModel.PhoneNumber" />
                        </Field>
                        <Field>
                            <Button Color="Color.Primary" Clicked="@UpdatePersonalInfoAsync">@L["Save"]</Button>
                        </Field>
                    </TabPanel>
                }
            </Content>
        </Tabs>
    </Column>
</Row>